

            function addArduinoCod (Blockly) {
            
                        

                        
        Blockly.Arduino['EXT_GENERAL_ULTRASONIC_BLOCK_1607330617376'] = function(block)
        {
            let e_pin = this.getFieldValue('e_pin');
let t_pin = this.getFieldValue('t_pin');
          
            Blockly.Arduino.definitions_['include_EXT_GENERAL_ULTRASONIC_BLOCK_1607330617376'] = ``;
            Blockly.Arduino.definitions_['define_EXT_GENERAL_ULTRASONIC_BLOCK_1607330617376'] = `const int TrigPin${t_pin} = ${t_pin};\r\nconst int EchoPin${e_pin} = ${e_pin};\r\nfloat Ultrasound_Value;\r\n\r\n\r\nfloat Ultrasound () {\r\n digitalWrite(TrigPin${t_pin}, LOW);\r\n delayMicroseconds(2);\r\n digitalWrite(TrigPin${t_pin}, HIGH);\r\n delayMicroseconds(10);\r\n digitalWrite(TrigPin${t_pin}, LOW);\r\n Ultrasound_Value=pulseIn(EchoPin${e_pin}, HIGH) / 58.00;\r\n return Ultrasound_Value;\r\n}`;
            Blockly.Arduino.definitions_['setup_EXT_GENERAL_ULTRASONIC_BLOCK_1607330617376'] = `pinMode(TrigPin${t_pin}, OUTPUT);\r\n  pinMode(EchoPin${e_pin}, INPUT);`;
             return  [`Ultrasound ()`];
        }
                    
            return Blockly;
            }

            module.exports = addArduinoCod ;

        